import logging

from appium.webdriver.common.mobileby import MobileBy
from Hogwarts.Homeworks.hw0704.page_objects.base import Base

"""
PAGE：企业微信APP首页
"""


class PageMain(Base):

    _MENU_MSG = (MobileBy.XPATH, "//*[@text='消息']")
    _MENU_CONTACT = (MobileBy.XPATH, "//*[@text='通讯录']")
    _MENU_WORKBENCH = (MobileBy.XPATH, "//*[@text='工作台']")
    _MENU_ME = (MobileBy.XPATH, "//*[@text='我']")

    def click_contact(self):
        logging.info("STEP：点击【通讯录】页签")
        from Hogwarts.Homeworks.hw0704.page_objects.page_contact import PageContact

        self.find_and_click(*self._MENU_CONTACT)
        return PageContact(self.driver)

    def click_msg(self):
        pass
        # logging.info("STEP：点击【消息】页签")
        # self.find_and_click(*self._MENU_MSG)
        # return PageMsg(self.driver)

    def click_workbench(self):
        """点击页签【工作台】"""
        pass

    def click_me(self):
        """点击页签【我】"""
        pass